#ifndef BYTE_ARRAY_H
#define BYTE_ARRAY_H

#include <string>



class ByteArray
{
private:

	char*			m_data;
	unsigned int	m_dataLen;
	unsigned int	m_dataPointer;

public:

	ByteArray();
	~ByteArray();

	void	seek(unsigned int pos);
	void	seekBegin();
	void	seekEnd();
	unsigned int position();

	unsigned int length();
	void	clear();

	int		readInt();
	double	readDouble();
	char*	readBytes();
	std::string	readUTF();

	void	writeBytes(char* bytes, unsigned int len);
	void	writeUTF(std::string str);
	void	writeInt(int value);
	void	writeDouble(double value);

private:
	void	checkAndResize(unsigned int len);
};

#endif